package com.kriss.favorite.common;

import java.util.List;

public class BaseBizImpl<T> implements IBaseBiz<T> {

	private IBaseDao dao ;

	public IBaseDao getDao() {
		return dao;
	}

	public void setDao(IBaseDao dao) {
		this.dao = dao;
	}

	public T save(T t) {
		try {
			dao.save(t);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return t;
	}

	public T udpate(T t) {
	
		return null;
	}

	public void delete(T t) {
		
	}

	public List<T> findByHql(String hql, Object... values) {
		List result =null;
		try {
			result = dao.findByHql(hql, values);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}

	public T saveOrupdate(T t) {
		
		try {
			dao.saveOrupdate(t) ;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return t ;
	}
	
	
}
